/*
 * Copyright 2009 XueSong Guo.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.webwheel.di;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 用来表明注入需求的注释接口。<br>
 * 此注释可放在类公开构造方法，类公开属性，类公开方法和类公开方法的形参之上。
 */
@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface Desire {

    /**
     * 默认的注入静态参数
     */
    String DefaultName = "";

    /**
     * 默认的注入动态参数
     */
    String DefaultData = "";

    /**
     * 此注入静态参数与注入地点的对象类型共同决定了注入标志，也就是{@link cn.webwheel.di.Key}类。
     * @return 注入静态参数
     */
    String value() default DefaultName;

    /**
     * 此参数的数据将提供给实例提供者{@link cn.webwheel.di.Provider}，以实现“动态”的注入。
     * @return 注入动态参数
     */
    String data() default DefaultData;

}
